﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MovieRental.Entities;
using MovieRental.BuisnessComponents;

namespace MovieRental.EnhancedEntities
{
    public class Movie : BaseEnhancedEntity<MovieInfo>
    {
        public Movie(MovieInfo movie)
            : base(movie)
        {
        }

        public int LoansCount
        {
            get { return ComponentFactory.Instance.GetLoanCartComponent().GetAllLoansCountForMovie(Entity); }
        }

        public int EditionsCount
        {
            get { return ComponentFactory.Instance.GetEditionComponent().GetAllEditionsForMovie(Entity.Id).Count(); }
        }

        public int NotReturnedLoansCount
        {
            get { return ComponentFactory.Instance.GetLoanCartComponent().GetNotReturnedLoansForMovieCount(Entity); }
        }
    }
}
